<?php

use think\facade\Route;

Route::group('api', function () {

    // [免登陆校验]
    Route::group('', function () {
        // 公共模块
        Route::group('public', function () {
            Route::get('slider', 'api.Data/getSlider')->name('公共.轮播图模块.获取轮播图片数据');
            Route::get('welcome', 'api.Data/getWelcome')->name('获取欢迎页图片');
            Route::get('cs-phone', 'api.Data/getCsPhone')->name('公共.基础配置.获取客服电话');
            Route::post('upload', 'api.Upload/file')->name('文件上传入口');
            Route::post('oss', 'api.Upload/oss')->name('阿里云上传文件签名');
            Route::post('send-sms', 'api.Sms/send')->name('发送短信');
            Route::post('check-sms', 'api.Sms/check')->name('短信验证码校验');
            Route::get('version', 'api.Data/version')->name('版本信息');
            Route::get('get-data', 'api.Data/getData')->name('获取指定数据对象');
            Route::get('get-cattle-config', 'api.Data/getCattleConfig')->name('获取牛超市配置');
            Route::get('order/refund-reason', 'api.Data/refundReason')->name('订单退款原因');
            Route::get('add-price-type', 'api.Data/addPriceType')->name('增加费用项列表');


            Route::get('map-tencent', 'api.Map/tencentGeoCoder')->name('腾讯地图逆地址解析');

            Route::get('ad', 'api.Ad/getItem')->name('获取广告数据列表');
            Route::get('ad-detail', 'api.Ad/getAdDetail')->name('获取广告详情数据');

            Route::get('poster', 'api.Poster/getItem')->name('获取海报数据列表');
            Route::get('poster-detail', 'api.Poster/getAdDetail')->name('获取海报详情数据');

            Route::post('recognize-driving-license', 'api.ALiYun/recognizeDrivingLicense')->name('行驶证识别');
            Route::post('recognize-id-card', 'api.ALiYun/recognizeIdentityCard')->name('身份证识别');
            Route::post('recognize-bank-card', 'api.ALiYun/recognizeBankCard')->name('银行卡识别');
            Route::post('check-bank', 'api.ALiYun/checkBank')->name('银行卡信息校验');
            Route::get('trace', 'api.ALiYun/trace')->name('物流查询');

            Route::get('platform-message', 'api.Data/platformMessage')->name('获取平台通知');
            Route::get('monitoring-station', 'api.MonitoringStation/get')->name('获取检测站');
            Route::get('normal-monitoring-station', 'api.MonitoringStation/userGet')->name('监测站管理.司机获取可用的检测站');

            Route::get('wxapp/qr-code', 'api.Wxapp/qrcodeB')->name('获取小程序码B');

            Route::get('bank/bank_name', 'api.Bank/branchName')->name('获取银行名称');
            Route::get('bank/sub_branch_name', 'api.Bank/subBranchName')->name('获取支行列表');


            Route::get('car/vehicle-type', 'api.Car/vehicleType')->name('获取分车辆类型');
        });

        // 用户
        Route::get('check-token', 'api.Login/checkToken')->name('校验token是否失效');
        Route::get('user-info', 'api.User/getUserInfo')->name('获取用户资料');

        Route::post('wxapp/silent-login', 'api.Wxapp/silentLogin')->name('微信小程序静默登录');
        Route::post('wxapp/decode', 'api.Wxapp/decode')->name('微信授权decode');

        // 汽车管理
        Route::get('other/car-info', 'api.Car/get')->name('获取车辆');
        Route::get('other/car-detail', 'api.Car/detail')->name('获取车辆详情');


    });


    // [需要登陆校验]
    Route::group('', function () {

        // 个人中心
        Route::get('user', 'api.auth.Center/get')->name('获取用户资料');
        Route::post('user', 'api.auth.Center/set')->name('更新用户资料');
        Route::post('register-service-provider', 'api.auth.Center/registerServiceProvider')->name('服务商注册');
        Route::post('user/change-phone', 'api.auth.Center/changePhone')->name('换绑手机');
        Route::post('user/bind-invite-code', 'api.auth.Center/bindInviteCode')->name('绑定邀请码');
        Route::post('user/bind-invite-code', 'api.auth.Center/bindInviteCode')->name('绑定邀请码');
        Route::post('user/real-name-authentication', 'api.auth.Center/realNameAuthentication')->name('身份证二要素识别绑定');

        Route::get('wxapp/phone', 'api.auth.Center/phone')->name('授权绑定手机号码');
        Route::get('user/son', 'api.auth.Center/son')->name('获取好友列表');

        // 消息管理
        Route::get('message-detail', 'api.auth.Message/detail')->name('消息详情');
        Route::get('message-overview', 'api.auth.Message/overview')->name('未读消息总览');
        Route::get('message', 'api.auth.Message/get')->name('获取消息列表');

        // 收益明细
        Route::get('balance/get', 'api.auth.Balance/get')->name('账户明细记录');
        Route::get('balance/detail', 'api.auth.Balance/detail')->name('我的钱包');
        Route::get('balance/actual-receipt', 'api.auth.Balance/actualReceipt')->name('获取实际到账金额');

        // 提现管理
        Route::post('transfer', 'api.auth.Transfer/add')->name('申请提现');
        Route::get('transfer/config', 'api.auth.Transfer/config')->name('获取用户提现配置');

        // 汽车管理
        Route::post('car-info', 'api.auth.CarInfo/set')->name('添加车辆');
        Route::get('car-info', 'api.auth.CarInfo/get')->name('获取车辆');
        Route::post('car-info/delete', 'api.auth.CarInfo/remove')->name('删除车辆');

        // 优惠券管理
        Route::get('coupon', 'api.auth.Coupon/get')->name('优惠券管理.优惠券列表');
        Route::get('coupon-list', 'api.auth.Coupon/couponList')->name('优惠券管理.待领取的优惠券列表');
        Route::post('got-coupon', 'api.auth.Coupon/gotCoupon')->name('优惠券管理.领取优惠券');
        Route::get('can-use-coupon', 'api.auth.Coupon/canUse')->name('优惠券管理.可用优惠券列表');

        // 服务商管理
        Route::get('service/monitoring-station', 'api.auth.MonitoringStation/get')->name('服务商检测站列表');

        // 订单管理
        Route::post('order/calc', 'api.auth.Order/calc')->name('订单管理.计算价格');
        Route::post('order', 'api.auth.Order/add')->name('订单管理.提交订单');
        Route::post('order/mock', 'api.auth.Order/mock')->name('【测试使用】模拟支付');
        Route::post('order/payment', 'api.auth.Order/payment')->name('获取订单支付参数');
        Route::get('order', 'api.auth.Order/get')->name('订单列表');
        Route::get('order/detail', 'api.auth.Order/detail')->name('订单详情');
        Route::post('order/confirm', 'api.auth.Order/confirm')->name('确认年审结束');

        // 服务商订单管理
        Route::get('service-order-list', 'api.auth.ServiceProviderOrder/get')->name('查看进度列表');
        Route::get('service-order/receiving-list', 'api.auth.ServiceProviderOrder/receivingList')->name('接单列表');
        Route::get('service-order/receiving-detail', 'api.auth.ServiceProviderOrder/receivingDetail')->name('接单详情');
        Route::post('service-order/receiving', 'api.auth.ServiceProviderOrder/receiving')->name('服务商接单');
        Route::post('service-order/receiving-today-count', 'api.auth.ServiceProviderOrder/receivingTodayCount')->name('服务商今日接单数');
        Route::get('service-order/detail', 'api.auth.ServiceProviderOrder/detail')->name('服务商接单');
        Route::post('service-order/plan-offline', 'api.auth.ServiceProviderOrder/planOffline')->name('预约线下审车');
        Route::post('service-order/consult-add-price', 'api.auth.ServiceProviderOrder/consultAddPrice')->name('费用协商');
        Route::post('service-order/plan-review', 'api.auth.ServiceProviderOrder/planReview')->name('安排年审');
        Route::post('service-order/complete', 'api.auth.ServiceProviderOrder/complete')->name('年审完成');

        // 银行卡管理
        Route::post('bank', 'api.auth.Bank/set')->name('添加修改银行卡');
        Route::get('bank', 'api.auth.Bank/detail')->name('获取银行卡详情');
    });

})->allowCrossDomain();

